import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.ipc.RPC;
import protocol.MyProtocol;
import server.MyProtocolImpl;

import java.io.IOException;

/**
 * @author rikun
 */
public class ServerStart {

    public static void main(String[] args) {
        try {
        RPC.Builder builder = new RPC.Builder(new Configuration());
        builder.setBindAddress("127.0.0.1")
               .setPort(8848)
               .setProtocol(MyProtocol.class)
               .setInstance(new MyProtocolImpl())
               .build()
               .start();
        System.out.println("Service started");
        } catch (IOException e) {
            e.printStackTrace();
        }

    }
}
